package com.monitor.zk.zookeeper.core.mq;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.client.producer.SendStatus;

@Slf4j
public class SendCallBackListen implements SendCallback {

    @Override
    public void onSuccess(SendResult sendResult) {
        if(sendResult.getSendStatus() == SendStatus.SEND_OK){
            log.info("发送成功：{}",sendResult.toString());
        }
    }

    @Override
    public void onException(Throwable throwable) {
        log.error("发送失败：{}",throwable.getMessage());
    }
}
